package com.mrjy.share.dao;

import java.util.List;

import com.mrjy.common.entity.ShareCodeInfo;

public interface IShareCodeDao {
	
	public int insert(ShareCodeInfo shareCode);
	
	public int insertBatch(List<ShareCodeInfo> scList);
	
	public int updateById(ShareCodeInfo shareCode);
	
	public ShareCodeInfo queryById(int scId);
	
	public List<ShareCodeInfo> listShareCodeInfo(ShareCodeInfo shareCode);
	
	public int countShareCdoeInfo(ShareCodeInfo shareCode);
	
	//查询统计一级或二级推荐推荐会员总数 
	public  List<ShareCodeInfo> listMemberCountByShareCode(ShareCodeInfo shareCode);
	/**
	 *  检查是否被一级分销员邀请
	 */
	public ShareCodeInfo selectByMobilePhone(String mobilePhone);
	/**
	 * 更新邀请状态值
	 * @param info
	 * @return
	 */
	public int updateStatusByMobilePhone(ShareCodeInfo info);
	/**
	 * 统计一级分销下所有二级分销成员及其推荐总人数
	 * @param info
	 * @return
	 */
	public List<ShareCodeInfo> queryCountSecondary(ShareCodeInfo info);
	/**
	 * 统计一级分销下所有二级分销成员总数
	 * @param info
	 * @return
	 */
	public int countSecondary(ShareCodeInfo info);
	/**
	 * 统计一级分销下所有二级分销成员分销总数
	 * @param info
	 * @return
	 */
	public int countAllByUserId(ShareCodeInfo info);

	public ShareCodeInfo queryUnshareCode(ShareCodeInfo info);

	public List<ShareCodeInfo> queryShareCodeDetail(ShareCodeInfo info);
	/**
	 * 通过userId 获取信息
	 * @param userId
	 * @return
	 */
	public ShareCodeInfo selectByUserId(Integer userId);
	/**
	 * 通过userId和分享码查询被推荐人名称和手机号码
	 */
	public ShareCodeInfo queryByUserIdAndShareCode(ShareCodeInfo info);
	/**
	 * 通过userId和ShareCode更新记录
	 * @param info
	 * @return
	 */
	public int updateByUserIdAndShareCode(ShareCodeInfo info);
	/**
	 * 查询一级分销员还没有分享的子分享码条数
	 * @author csshui
	 * @param info 
	 * @return
	 */
	public int queryUnShareCodeCount(ShareCodeInfo info);
	
	
	
}
